#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N = 2e5;
const int maxn = 1e6;
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int arr[60];
void solve()
{
	int n;
	sd(n);
	int a[60];
	int b[60];
	int pos1 = 1;
	int pos2 = 1;
	for (int i = 1; i <= n; i++)
	{
		if (i % 2 == 0)
		{
			sd(a[pos1]);
			pos1++;
		}
		if (i % 2 != 0)
		{
			sd(b[pos2]);
			pos2++;
		}
	}

	int flag1 = 0;
	if (a[1] % 2 == 0) flag1 = 0;
	else flag1 = 1;
	if (flag1 == 0)//偶数
	{
		for (int i = 1; i <pos1; i++)
		{
			if (a[i] % 2 != 0)
			{
				cout << "NO" << '\n';
				return;
			}
		}
	}
	else if (flag1 == 1)
	{
		for (int i = 1; i <pos1; i++)
		{
			if (a[i] % 2 == 0)
			{
				cout << "NO" << '\n';
				return;
			}
		}

	}

	int flag2 = 0;
	if (b[1] % 2 == 0) flag2 = 0;
	else flag2 = 1;
	if (flag2 == 0)//偶数
	{
		for (int i = 1; i <pos2; i++)
		{
			if (b[i] % 2 != 0)
			{
				cout << "NO" << '\n';
				return;
			}
		}
	}
	else if (flag2 == 1)//偶数
	{
		for (int i = 1; i <pos2; i++)
		{
			if (b[i] % 2 == 0)
			{
				cout << "NO" << '\n';
				return;
			}
		}
	}

	cout << "YES" << '\n';
}





int main()
{
	int T;
	sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}